package com.qf.flash.ui.home.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;

import com.qf.flash.R;
import com.qf.flash.http.response.BannerBean;
import com.qf.flash.utils.ImageLoader;
import com.zhouwei.mzbanner.holder.MZViewHolder;

/** 首页Banner适配器
 * 2018/3/30 17:00
 */
public class HomePageBannerViewHolder implements MZViewHolder<BannerBean>
{
    private ImageView iv_img;

    @Override
    public View createView(Context context)
    {
        View view = LayoutInflater.from(context).inflate(R.layout.item_homepage_banner_item, null);
        iv_img = (ImageView) view.findViewById(R.id.iv_img);
        return view;
    }

    @Override
    public void onBind(final Context context, int position, final BannerBean data)
    {
        //加载图片
        ImageLoader.load(context, data.getAdvertUrl(),iv_img);
        //点击事件

    }
}
